package com.linq.cool.api.vo;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Objects;

/**
 * @Author: yqlin
 * @Date: 2021/1/30 22:47
 * @Description: 网页登录用户使用
 * @Version: 1.0.0
 */
@Data
@Accessors(chain = true)
public class WebLoginUser implements Serializable {
    private String token;
    private Long userId;
    private String nickname;
    private String phone;
    private String password;
    private String avatar;
    private Integer status;
    private Integer gender;
    /**
     * 登录时间
     */
    private Long loginTime;
    /**
     * 过期时间
     */
    private Long expireTime;
    /**
     * 登录IP地址
     */
    private String loginIp;
    /**
     * 1 代表管理系统系统
     * 2 微信
     */
    private Integer loginType;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof WebLoginUser)) {
            return false;
        }
        WebLoginUser that = (WebLoginUser) o;
        return userId.equals(that.userId) && phone.equals(that.phone) && loginType.equals(that.loginType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userId, phone, loginType);
    }
}
